package top.littlejiang.onlinexam.common.base;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * @author chen
 * @Description
 * @since 2020/12/26 16:31
 */
@Data
@SuppressWarnings("serial")
public class BaseEntity implements Serializable {
	/** 由mybatis-plus.global-config.sql-injector:com.baomidou.mybatisplus.mapper.LogicSqlInjector自动维护 */
	@TableLogic
	private boolean isDeleted;
	@TableField(fill = FieldFill.INSERT, update = "NOW()")
	private Date createAt = new Date();
	@TableField(fill = FieldFill.UPDATE, update = "NOW()")
	private Date updateAt;

	/** 由LogAspect.logMapper自动维护 */
	private int createBy;
	private int updateBy;
}
